from typing import Optional
from datetime import datetime
from pydantic import condecimal
from .base import BaseSchema

# 航空公司
class CarrierBase(BaseSchema):
    Code: str
    Name: str
    EnglishName: Optional[str] = None
    IATA: Optional[str] = None
    ICAO: Optional[str] = None

class CarrierCreate(CarrierBase):
    pass

class CarrierUpdate(CarrierBase):
    pass

class Carrier(CarrierBase):
    ID: int
    CreateTime: datetime
    UpdateTime: Optional[datetime] = None

# 机场
class AirportBase(BaseSchema):
    Code: str
    Name: str
    CityName: str
    CityPinYin: str
    CounterAddress: Optional[str] = None
    IsInternational: bool
    EglishName: Optional[str] = None
    FullName: str

class AirportCreate(AirportBase):
    pass

class AirportUpdate(AirportBase):
    pass

class Airport(AirportBase):
    ID: int
    CreateTime: datetime
    UpdateTime: Optional[datetime] = None

# 飞机型号
class AirplaneBase(BaseSchema):
    PlaneModel: str
    Shape: str
    Company: str
    MinSeatCount: int
    MaxSeatCount: int
    PhotoUrl: Optional[str] = None

class AirplaneCreate(AirplaneBase):
    pass

class AirplaneUpdate(AirplaneBase):
    pass

class Airplane(AirplaneBase):
    ID: int
    CreateTime: datetime
    UpdateTime: Optional[datetime] = None

# 酒店信息
class HotelInfoBase(BaseSchema):
    HotelId: str
    HotelName: str
    HotelEnglishName: str
    RankCode: str
    Address: str
    TrafficInfo: Optional[str] = None
    Floor: str
    RoomQuantity: str
    QuotaPerDays: str
    Promotion: Optional[str] = None
    Telephone: str
    BasicInfo: str
    Guarantee: str
    Currency: str
    CityCode: str
    FAX: Optional[str] = None
    Exceptive: Optional[str] = None
    AgentCommisionRate: str
    GuaranteePolicy: str
    Policy: str
    YLPolicy: str
    OpenDate: str
    FitMent: str
    PositionOfRemark: str

class HotelInfoCreate(HotelInfoBase):
    pass

class HotelInfoUpdate(HotelInfoBase):
    pass

class HotelInfo(HotelInfoBase):
    ID: int
    CreateTime: datetime
    UpdateTime: Optional[datetime] = None 